package com.web.service;

import com.web.com.web.entity.Student;
import com.web.mapper.StudentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentService {

    @Autowired
    private StudentMapper studentMapper;

    public List<Student> findAll(){
        return studentMapper.list();
    }

    public Student findById(Integer id){
        return studentMapper.get(id);
    }

    public void save(Student student){
        studentMapper.insert(student);
    }

    public void update(Student student){
        studentMapper.update(student);
    }

    public void delete(Integer id){
        studentMapper.delete(id);
    }

}
